package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BsLotteryHistoryMapper;
import com.ruoyi.system.domain.BsLotteryHistory;
import com.ruoyi.system.service.IBsLotteryHistoryService;

/**
 * 抽奖记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-12-25
 */
@Service
public class BsLotteryHistoryServiceImpl implements IBsLotteryHistoryService 
{
    @Autowired
    private BsLotteryHistoryMapper bsLotteryHistoryMapper;

    /**
     * 查询抽奖记录
     * 
     * @param lotteryId 抽奖记录主键
     * @return 抽奖记录
     */
    @Override
    public BsLotteryHistory selectBsLotteryHistoryByLotteryId(Long lotteryId)
    {
        return bsLotteryHistoryMapper.selectBsLotteryHistoryByLotteryId(lotteryId);
    }

    /**
     * 查询抽奖记录列表
     * 
     * @param bsLotteryHistory 抽奖记录
     * @return 抽奖记录
     */
    @Override
    public List<BsLotteryHistory> selectBsLotteryHistoryList(BsLotteryHistory bsLotteryHistory)
    {
        return bsLotteryHistoryMapper.selectBsLotteryHistoryList(bsLotteryHistory);
    }

    /**
     * 新增抽奖记录
     * 
     * @param bsLotteryHistory 抽奖记录
     * @return 结果
     */
    @Override
    public int insertBsLotteryHistory(BsLotteryHistory bsLotteryHistory)
    {
        bsLotteryHistory.setCreateTime(DateUtils.getNowDate());
        return bsLotteryHistoryMapper.insertBsLotteryHistory(bsLotteryHistory);
    }

    /**
     * 修改抽奖记录
     * 
     * @param bsLotteryHistory 抽奖记录
     * @return 结果
     */
    @Override
    public int updateBsLotteryHistory(BsLotteryHistory bsLotteryHistory)
    {
        return bsLotteryHistoryMapper.updateBsLotteryHistory(bsLotteryHistory);
    }

    /**
     * 批量删除抽奖记录
     * 
     * @param lotteryIds 需要删除的抽奖记录主键
     * @return 结果
     */
    @Override
    public int deleteBsLotteryHistoryByLotteryIds(Long[] lotteryIds)
    {
        return bsLotteryHistoryMapper.deleteBsLotteryHistoryByLotteryIds(lotteryIds);
    }

    /**
     * 删除抽奖记录信息
     * 
     * @param lotteryId 抽奖记录主键
     * @return 结果
     */
    @Override
    public int deleteBsLotteryHistoryByLotteryId(Long lotteryId)
    {
        return bsLotteryHistoryMapper.deleteBsLotteryHistoryByLotteryId(lotteryId);
    }
}
